home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / pnn.nnc < prev    next >
Text File  |  1993-08-23  |  3KB  |  80 lines

  1. csv3.0        !file format is Control Strategy Version 3.0
  2. ! 05-Jun-89  (pnn.nnc)  Probabilistic Neural Network
  3. !************************************************************************
  4. !*                                    *
  5. !*    Probabilistic Neural Network Control Strategy            *
  6. !*                                    *
  7. !************************************************************************
  8. !
  9. !    *** Recall ***
  10. !
  11. !MASK     label    op-code    operands    comment
  12. L_saR_sa    trace    aux3        !  set trace option to aux3
  13. L_saR_sa    cset    recall,1    !  recall count
  14. !
  15. ! Initialize ce field with 1/N
  16.  
  17. L_saRi_a    lset    out,-2        !  pattern layer
  18. L_saRi_a    math    e=0        !  zero out error field
  19. L_saRi_a    lset    out,-1        !  summation layer
  20. L_saRi_a    math    e=0|setb
  21. L_saRi_a    math    backp        !  backprop 1's through 1/N
  22. L_saRi_a    lset    out,-2        !  pattern layer
  23. L_saRi_a    math    ce=e|e=0    !  Store 1/N in ce field
  24.  
  25. L___R_sa    lset    in        !  input layer
  26. L___R_sa    io    read        !  get input data
  27. L___R_sa @rloop    math    sum        !  perform sum (for norm layer)
  28. L___R_sa    math    rnoise|tran|output
  29. L___R_sa    lset    cur,1        !  next layer
  30. L___R_sa    lcmp    out        !  at output layer ?
  31. L___R_sa    blt    @rloop        !  loop till done
  32. L___R_sa    io      rcltst
  33. L___R_sa    math    sum|ce=e|tran|output|e-=w|swap
  34. L___R_sa    io    write        !  write results
  35. L___R_sa    brct    @exit        !  skip to end
  36. !
  37. !    *** Learning ***
  38. !
  39. L_saR___    lset    in        !  start at input layer
  40. L_saR___    io    lrnin        !  get input data
  41. L_saR___ @ll1    math    e=0|w=0        !  clear error & output
  42. L_saR___    lcmp    out        !  done?
  43. L_saR___    lset    cur, 1        !  next layer
  44. L_saR___    blt    @ll1        !  do it again
  45. L_saR___    lset    out        !  explicitly set for DPACK's sake
  46. L_saR___    io    lrnout        !  get desired output
  47. !
  48. !    back-propagate the error to control which PEs learn
  49. !
  50. L_saR___    math    backp        !  bkp error to summation lyr
  51. L_saR___    lset    cur,-1        !  summation layer
  52. L_saR___    math    backp        !  bkp error to pattern lyr
  53. !
  54. !    perform a normal recall until we hit the pattern layer
  55. !
  56. L_saR___    lset    in        !  start with input layer
  57. L_saR___ @ll2    math    sum        !  sum (for Norm layer)
  58. L_saR___    math    lnoise|tran|output|learn
  59. L_saR___    lset    cur,1        !  next layer
  60. L_saR___    lcmp    out,-2        !  are we at pattern layer?
  61. L_saR___    blt    @ll2        !  not yet
  62. !
  63. L_saR___    math    sum|lnoise|tran|gate|output|learn ! Learn
  64. L_saR___    lset    cur,1        !  summation layer
  65. L_saR___    math    learn        !  weights = 1/N
  66. !
  67. !    Now calculate outputs
  68. !
  69. !L_saR___    lset    cur,-1        !  pattern layer
  70. L_saR___ @ll3    math    sum|lnoise|tran|output
  71. L_saR___    lset    cur,1        !  next layer
  72. L_saR___    lcmp    out        !  are we at output layer?
  73. L_saR___    blt    @ll3        !  not yet
  74. L_saR___     math    sum|lnoise|tran|output ! final output
  75. !
  76. !    Tidy up, and tell what actually happened
  77. !
  78. L_saR___    io    lrnrslt        !  tell userio what happened
  79. LisaRisa @exit    trace    0        !  turn off any trace function
  80.